From 7351c79e2d2629189e6e4fcf72c15c04ba94a5df Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Thu, 15 Aug 2013 23:05:01 +0000 Subject: [PATCH] compatibility fix for Qt 4.6. --- gpsbabel/kml.cc | 2 +- gpsbabel/src/core/datetime.h | 8 -------- gpsbabel/tiger.cc | 2 +- gpsbabel/waypt.cc | 2 +- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/gpsbabel/kml.cc b/gpsbabel/kml.cc index 7a39fb915..23e379cdd 100644 --- a/gpsbabel/kml.cc +++ b/gpsbabel/kml.cc @@ -1844,7 +1844,7 @@ void kml_write_AbstractView(void) // the network position. So we shove the end of the timespan out to // ensure the right edge of that time slider includes us. // - time_max = realtime_positioning ? kml_time_max + 600 : kml_time_max; + time_max.setTime_t(realtime_positioning ? kml_time_max.toTime_t() + 600 : kml_time_max.toTime_t()); writer->writeTextElement("end", time_max.toPrettyString()); } writer->writeEndElement(); // Close gx:TimeSpan tag diff --git a/gpsbabel/src/core/datetime.h b/gpsbabel/src/core/datetime.h index 4f08a88f4..b0e24eb9e 100644 --- a/gpsbabel/src/core/datetime.h +++ b/gpsbabel/src/core/datetime.h @@ -55,14 +55,6 @@ public: return toTime_t(); } - DateTime operator+(quint64 seconds) { - return DateTime::fromMSecsSinceEpoch(toMSecsSinceEpoch() + seconds*1000); - } - - DateTime operator-(quint64 seconds) { - return DateTime::fromMSecsSinceEpoch(toMSecsSinceEpoch() - seconds*1000); - } - // Integer form: YYMMDD int ymd() const { QDate d(date()); diff --git a/gpsbabel/tiger.cc b/gpsbabel/tiger.cc index b39c836cd..a071aa498 100644 --- a/gpsbabel/tiger.cc +++ b/gpsbabel/tiger.cc @@ -189,7 +189,7 @@ tiger_disp(const waypoint *wpt) pin = wpt->icon_descr; } else if (wpt->icon_descr.contains("-unfound")) { pin = unfoundmarker; - } else if (wpt->GetCreationTime() > current_time() - 3600 * 24 * thresh_days) { + } else if (wpt->GetCreationTime().toTime_t() > current_time().toTime_t() - 3600 * 24 * thresh_days) { pin = newmarker; } else { pin = oldmarker; diff --git a/gpsbabel/waypt.cc b/gpsbabel/waypt.cc index 45fd0fa75..e5650ce72 100644 --- a/gpsbabel/waypt.cc +++ b/gpsbabel/waypt.cc @@ -545,7 +545,7 @@ waypt_time(const waypoint *wpt) if (!wpt->creation_time.isValid()) { return (double) 0; } else { - return ((double)wpt->creation_time.toMSecsSinceEpoch()) / 1000.0; + return (double)wpt->creation_time.toTime_t(); } } -- 2.30.2